from django.http import HttpResponse
from django.template.response import TemplateResponse
from pybo.mylessons.models import Lesson, LessonNode
from pybo.myproblems.models import MySubmitForm, MySubmit, Problem
from django.http import Http404, HttpResponseRedirect
from pybo.invoker import invoker

def submits(request, problem_id):
    all_submits = MySubmit.objects.filter(problem__id=problem_id, author = request.user).order_by('id')
    problem = Problem.objects.get(pk=problem_id)
    return TemplateResponse(request, 'submits.html', 
           {'submits': all_submits, 'problem': problem})
    